package il.ac.technion.wiki.api.search;

import il.ac.technion.wiki.api.wikidocument.IWikiDocument;
import il.ac.technion.wiki.impl.search.WikiNeutralWordsCleaner;
import il.ac.technion.wiki.impl.search.WikiScorePolicy;

import java.util.LinkedList;
import java.util.List;

public abstract class IndexSearcher {
	
	protected NeutralWordsCleaner cleaner;
	protected IScorePolicy scorePolicy;
	
	public IndexSearcher(){
		//default members
		cleaner 	= new WikiNeutralWordsCleaner();
		scorePolicy = new WikiScorePolicy();
	}
	
	public IndexSearcher(LinkedList<IWikiDocument> dl, NeutralWordsCleaner c,
			IScorePolicy sp){
		cleaner 	= c;
		scorePolicy = sp;
	}
	abstract public List<Hit> getTermHits(String term);
	abstract public List<Hit> getAllDocsHits();
	public long notScore(long a){
		return scorePolicy.notScore(a);
	}
	public long andScore(long a, long b){
		return scorePolicy.andScor(a, b);
	}
	public long orScore(long a, long b){
		return scorePolicy.orScore(a, b);
	}
	
	public abstract void addDocument(IWikiDocument toAdd);
	public abstract void removeDocument(IWikiDocument toRemove);
}